#include<iostream>
#include<algorithm>
#include<cstring>

using namespace std;

const int N = 110;

int n;
int q[N];


bool dfs(int u, int depth){
    if(u > depth)
        return false;

    if(q[u] == n)
        return true;

    bool st[N] = {0};
    for (int i = u; i > 0; i--){
        for (int j = i; j > 0; j --){
            int s = q[i] + q[j];
            if(s > n || s <= q[u] || st[s])
                continue;
            st[s] = true;
            q[u + 1] = s;
            if(dfs(u + 1, depth))
                return true;

        }
    }

    return false;
}

//迭代加深
int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    while(cin >> n, n){
        q[1] = 1;
        int depth = 1;
        while(!dfs(1, depth))
            depth++;

        for (int i = 1; i <= depth; i ++)
            cout << q[i] << " ";

        cout << endl;
    }
    return 0;
}